package com.yunxi.controller.eai;

import com.yunxi.baseDataToHub.pojo.urm.*;
import com.yunxi.baseDataToHub.service.urm.UrmDubboService;
import com.yunxi.core.web.ApiResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by Administrator on 2019/8/5.
 */
@RestController
@RequestMapping("/esb/api")
@Api(tags = "esb:manage", value = "接收esb信息")
public class UrmController {

    @Autowired
    private UrmDubboService urmDubboServiceImpl;
    @PostMapping("/sendClientInfoPMS2Urm")
    @ApiOperation(value = "发送客户信息到urm")
    public ApiResult sendClientInfoPMS2Urm(@Validated @RequestBody ClientInfoVO order) throws Exception {
        ApiResult apiResult = urmDubboServiceImpl.sendClientInfoPMS2Urm(order);
        return apiResult;
    }

    @PostMapping("/selectAccountByMobilePMS2Urm")
    @ApiOperation(value = "通过手机号获取用户信息")
    public ApiResult selectAccountByMobilePMS2Urm(@Validated @RequestBody UserInfoVO info) throws Exception {
        ApiResult apiResult = urmDubboServiceImpl.selectAccountByMobilePMS2Urm(info);
        return apiResult;
    }

    @PostMapping("/sendFollowInformationPMS2Urm")
    @ApiOperation(value = "PMS系统发送跟进数据给URM")
    public ApiResult sendFollowInformationPMS2Urm(@RequestBody FollowInformationVO order) throws Exception {
        ApiResult apiResult = urmDubboServiceImpl.sendFollowInformationPMS2Urm(order);
        return apiResult;
    }
    @PostMapping("/sendIntentionalInformationPMS2Urm")
    @ApiOperation(value = "PMS系统发送意向信息给URM")
    public ApiResult sendIntentionalInformationPMS2Urm(@RequestBody IntentionalInformationVO order) throws Exception {
        ApiResult apiResult = urmDubboServiceImpl.sendIntentionalInformationPMS2Urm(order);
        return apiResult;
    }
    @PostMapping("/sendOrderInformationTransmissionPMS2Urm")
    @ApiOperation(value = "PMS系统发送订单信息给URM")
    public ApiResult sendOrderInformationTransmissionPMS2Urm(@RequestBody OrderInformationTransmissionVO order) throws Exception {
        ApiResult apiResult = urmDubboServiceImpl.sendOrderInformationTransmissionPMS2Urm(order);
        return apiResult;
    }
    @PostMapping("/sendUrmTestDrivePMS2Urm")
    @ApiOperation(value = "PMS系统发送试乘试驾信息给URM")
    public ApiResult sendUrmTestDrivePMS2Urm(@RequestBody UrmTestDriveVO order) throws Exception {
        ApiResult apiResult = urmDubboServiceImpl.sendUrmTestDrivePMS2Urm(order);
        return apiResult;
    }
    @PostMapping("/sendDeliveryVehiclePMS2Urm")
    @ApiOperation(value = "PMS系统发送交车信息给URM")
    public ApiResult sendDeliveryVehiclePMS2Urm(@RequestBody DeliveryVehicleVO order) throws Exception {
        ApiResult apiResult = urmDubboServiceImpl.sendDeliveryVehiclePMS2Urm(order);
        return apiResult;
    }
}
